package com.jzg.jcptadmin.adpter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import com.jzg.jcptadmin.R;

import java.util.List;

/**
 * Created by wangyd on 15/12/28.
 */
public class HistoryVinAdapter extends ArrayAdapter<String> {

    private final Context context;
    private final List<String> vins;

    public HistoryVinAdapter(Context context, List<String> vins) {
        super(context, -1, vins);
        this.context = context;
        this.vins = vins;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View itemView = inflater.inflate(R.layout.simple_list_content_center, parent, false);
        // vin
        TextView vin = (TextView) itemView.findViewById(R.id.content);
        vin.setText(vins.get(position));

        return itemView;
    }
}